POV-Ray : Newsgroups : povray.general : Need for new pattern - cubediv? : Re: Need for new pattern - cubediv? Server Time
31 Jul 2024 20:14:35 EDT (-0400)
  Re: Need for new pattern - cubediv?  
From: Warp
Date: 21 Sep 2006 04:42:11
Message: <45125062@news.povray.org>
Raf256 <spa### [at] raf256invalid> wrote:
> This trivial task turns out very hard, one have to create 3 or 6 shapes each
> with different texture and try to combine them. It not always work, and it
> is an ugly hack imho.

  No, one have not. I have posted this before:


camera { location -z*6 look_at 0 angle 35 }
light_source { <15, 20, -50>, 2 }

#declare Pyramid = function { abs(x) < y & abs(z) < y };

#declare CubePattern =
  function
  { Pyramid(x, -z, y)*1/6+
    Pyramid(y, x, z)*2/6+
    Pyramid(x, z, y)*3/6+
    Pyramid(y, -x, z)*4/6+
    Pyramid(x, -y, z)*5/6
  };

#declare Image =
  pigment
  { image_map { jpeg "image" }
    translate -.5
    scale 2
  };

#declare ThePigment =
  pigment
  { function { CubePattern(x, y, z) }
    pigment_map
    { [0/6 Image rotate x*90]
      [1/6 Image]
      [2/6 Image rotate -y*90]
      [3/6 Image rotate -y*180]
      [4/6 Image rotate y*90]
      [5/6 Image rotate -x*90]
    }
  };

superellipsoid
{ <.2, .2>
  pigment { ThePigment }
  rotate y*30 rotate x*-30
}



-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.